#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e5+5;
ll n,a[N],b[N],ans,i,j=1;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    a[0]=a[1];
    for(i=1;i<=n;i++){
        if(a[i]==a[i-1])
            b[j]++;
        else
            b[++j]++;
    }
    for(i=2;i<=j;i++){
        if(b[i]>=b[i-1])
            ans+=b[i-1];
        else{
            ans+=b[i];
            b[i]=b[i-1];
        }
    }
    cout<<n-ans;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
